<?php

namespace app\api\controller;


use app\common\controller\Api;
use app\common\model\Course as CourseModel;
use app\common\model\Type;

/**
 * 课文相关
 */
class Course extends Base
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = '*';
    //课文列表
    public function index(){
        $typeid = $this->request->post('typeid');
        $CourseModel = new CourseModel();
        $list = $CourseModel
            ->where(array('type_id'=>$typeid))
            ->order('weigh asc')
            ->select();
        $this->success('获取课文列表成功',array('data'=>$list));
    }

    public function typelist(){
        $TypeModel = new Type();
        $list = $TypeModel
            ->order('sort desc')
            ->select();
        $this->success('获取课文列表成功',array('data'=>$list));
    }



}
